package com.seecen.controller;


import com.seecen.service.OrderDetailService;
import com.seecen.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/orderDetail")
@CrossOrigin
public class OrderDetailController {


    @Autowired
    private OrderDetailService orderDetailService;

    //根据订单id查询订单细节
    @PostMapping("selectOrderByOId")
    public Result selectOrderByOId(@RequestParam Integer orderId){
        Result ret = orderDetailService.selectOrderByOId(orderId);
        return ret;
    }
    //根据用户id查询订单细节
    @PostMapping("selectOrderByUId")
    public Result selectOrderByUId(@RequestParam Integer userId){
        Result ret = orderDetailService.selectOrderByUId(userId);
        return ret;
    }
    //删除订单
    @DeleteMapping("selectOrderByid")
    public Result selectOrderByid(@RequestParam Integer id){
        Result ret = orderDetailService.selectOrderByid(id);
        return ret;
    }
    //根据用户id查地址
    @PostMapping("selectAddressByUid")
    private Result selectAddressByUid(@RequestParam Long userId){
        Result ret = orderDetailService.selectAddressByUid(userId);
        return ret;
    }

}
